<?php
//----------------------------------
// 公共入口文件
//----------------------------------
define('IN_API', true);
define('GZ_PATH', $_SERVER['DOCUMENT_ROOT'].'/Mapi');

require(GZ_PATH . '/library/function.php');
require(GZ_PATH . '/library/GZ_Api.php');
require(GZ_PATH . '/library/GZ_Cache.php');
require(GZ_PATH . '/library/lib_time.php');
require(GZ_PATH . '/library/lib_base.php');

require(GZ_PATH . '/conf/config.php');
require(GZ_PATH . '/conf/mysql.class.php');
require(GZ_PATH . '/conf/action.class.php');


/* 初始化设置 */
@ini_set('memory_limit',          '64M');
@ini_set('display_errors',        1);
ini_set("register_globals","1"); 
date_default_timezone_set("PRC"); //时区

//缓存时间
define('CACHE_TIME_H', 86400);//24小时
define('CACHE_TIME_D', 259200);//3天
define('CACHE_TIME_M', 259200);//1296000 半个月

/* 取得当前所在的根目录 */
define('ROOT_PATH', str_replace('library/App_Init.php', '', str_replace('\\', '/', __FILE__)));

spl_autoload_register('gz_autoload');


/* 对用户传入的变量进行转义操作。*/
if (!get_magic_quotes_gpc())
{
    if (!empty($_GET))
    {
        $_GET  = addslashes_deep($_GET);
    }
    if (!empty($_POST))
    {
        $_POST = addslashes_deep($_POST);
    }

    $_REQUEST  = addslashes_deep($_REQUEST);
}

/* 初始化数据库类 */
$db = new Action();



